package com.shfl.task.logic.service;

import com.github.pagehelper.PageInfo;
import com.shfl.task.logic.bean.TaskJob;
import com.shfl.task.logic.model.request.AddTaskJobRequest;
import com.shfl.task.logic.model.request.CloseTaskJobRequest;
import com.shfl.task.logic.model.request.OpenTaskJobRequest;
import com.shfl.task.logic.model.response.TaskJobResponse;
import com.shfl.task.pagehelper.Pageable;

import java.util.List;
import java.util.Map;

public interface TaskJobService {

    List<TaskJob> findListByMap(Map<String, Object> objectMap);

    /**
     * 新增定任务
     *
     * @param request
     * @throws Exception
     */
    void add(AddTaskJobRequest request) throws Exception;

    /**
     * 编辑定时任务
     *
     * @param request
     * @throws Exception
     */
    void edit(AddTaskJobRequest request) throws Exception;

    /**
     * 关闭定时任务
     *
     * @param request
     * @throws Exception
     */
    void close(CloseTaskJobRequest request) throws Exception;

    /**
     * 开启定时任务
     *
     * @param request
     * @throws Exception
     */
    void open(OpenTaskJobRequest request) throws Exception;

    void updateByPrimaryKeySelective(TaskJob taskJob);

    PageInfo<TaskJobResponse> findPage(Pageable pageable, Map<String, Object> objectMap);
}
